package com.newlink.building.userinfo.mvp.contract

import com.newlink.building.common_base.base.IModel
import com.newlink.building.common_base.base.IPresenter
import com.newlink.building.common_base.base.IView
import com.newlink.building.common_base.model.bean.*
import io.reactivex.Observable
import okhttp3.MultipartBody
import retrofit2.http.Part

/**
 * @author wangyang
 * @date 2022/9/16
 * @description 我的——账户信息页面的Contract
 */
interface Module_UserInfo_AccountInformationContract {

    interface Model : IModel {
        fun getUserInfo(token: String, userId: Long): Observable<HttpResult<UserInfoData>>
        fun getUserInfoNew(token: String, userId: Long): Observable<HttpResult<UserInfoResp>>
        fun setUserInfo(
            token: String,
            setUserInfoBean: SetUserInfoBean
        ): Observable<HttpResult<UserInfoData>>

        fun setUserNickName(
            token: String,
            userId: String,
            nickname: String
        ): Observable<HttpResult<ResponseTopData>>

        fun syncUserInfo(
            token: String,
            setUserInfoBean: UpdateAvatarBean
        ): Observable<HttpResult<UserInfoData>>

        fun uploadAvatar2(
            token: String,
            @Part("file") body: MultipartBody.Part
        ): Observable<HttpResult<AvatarResponse>>


        fun deleteAccount(
            token: String,
            userId: String,
            masterFlag: Boolean
        ): Observable<HttpResult<ResponseTopData>>
    }

    interface View : IView {
        //        fun getUserInfoSuccess(userInfo: UserInfoData)
        fun getUserInfoNewSuccess(userInfo: UserInfoResp)
        fun getUserInfoFail()
        fun setUserInfoSuccess()
        fun setUserInfoFail()
        fun uploadAvatarSuccess(avatarResponse: AvatarResponse)
        fun uploadAvatarFail()
        fun deleteAccountSuccess()
        fun deleteAccountFail()
    }

    interface Presenter : IPresenter<View> {
        fun getUserInfo(token: String, userId: Long)
        fun setUserInfo(token: String, userId: String, nickname: String)
        fun syncUserInfo(token: String, userInfoData: UpdateAvatarBean)
        fun uploadAvatar2(token: String, body: MultipartBody.Part)
        fun deleteAccount(token: String, userId: String, masterFlag: Boolean)
    }
}